<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	/**
	 * CodeIgniter
	 *
	 * An open source application development framework for PHP 4.3.2 or newer
	 *
	 * @package		CodeIgniter
	 * @author		ExpressionEngine Dev Team
	 * @copyright	Copyright (c) 2008 - 2009, EllisLab, Inc.
	 * @license		http://codeigniter.com/user_guide/license.html
	 * @link		http://codeigniter.com
	 * @since		Version 1.0
	 * @filesource
	 */
	// ------------------------------------------------------------------------
	
	/**
	 * @package		CodeIgniter
	 * @subpackage	Libraries
	 * @author		AnhDT
	 */
	require_once APP_LIBRARY_PATH . 'tree/paginator/scrolling/st_paginator_scrolling_interface.php';
	class st_paginator_scrolling_jumping implements st_paginator_scrolling_interface {
		public function getPages(st_paginator $paginator, $pageRange = null) {
			$pageRange  = $paginator->getPageRange();
			$pageNumber = $paginator->getCurrentPageNumber();
			
			$delta = $pageNumber % $pageRange;
			
			if ($delta == 0) {
				$delta = $pageRange;
			}
	
			$offset     = $pageNumber - $delta;
			$lowerBound = $offset + 1; 
			$upperBound = $offset + $pageRange;
			
			return $paginator->getPagesInRange($lowerBound, $upperBound); 
    	}
	}
?>